#pragma once
#ifndef DEBUG_VIEW_H
#define DEBUG_VIEW_H

#include <SFML/Graphics.hpp>
#include <Box2D.h>

struct b2AABB;

// This class implements debug drawing callbacks that are invoked
// inside b2World::Step.
class DebugView : public b2DebugDraw
{
public:

	DebugView(sf::RenderWindow* const window, const float physicsViewFactor, const float lineWidth);

	void DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color);

	void DrawSolidPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color);

	void DrawCircle(const b2Vec2& center, float32 radius, const b2Color& color);

	void DrawSolidCircle(const b2Vec2& center, float32 radius, const b2Vec2& axis, const b2Color& color);

	void DrawSegment(const b2Vec2& p1, const b2Vec2& p2, const b2Color& color);

	void DrawXForm(const b2XForm& xf);

private:

	sf::Color convertColor(const b2Color& color);

	sf::Vector2f convertVector(const b2Vec2& vector);

	sf::RenderWindow* const window;

	const float physicsViewFactor;

	float lineWidth;

};

#endif //DEBUG_VIEW_H
